;
; Hello world for Linux using libc
;
; Author: Renê de Souza Pinto
; Date..: Feb, 2009
;
; To compile: nasm hello_libc.asm -f elf
; To link:    gcc hello_libc.o -o hello_libc
;

[Bits 32]

[extern printf]
[extern exit]

[global main]

section .text

main:
	; Print message
	; Push arguments into the stack
	; and call printf
	mov eax, message
	push eax
	call printf

	; Exit program
	; Push arguments into the stack
	; and call exit
	mov eax,0x00 		; Return code
	push eax
	call exit

section .data

	message db 'Hello World!',13,10,0

